package global

type SaleStatus int64
type SaleType int64
type RefundType int64

const (
	SaleStatusPending      SaleStatus = 1  // 待处理
	SaleStatusBuyerReturn  SaleStatus = 2  // 待买家退货
	SaleStatusMerchantRecv SaleStatus = 3  // 待商家收货
	SaleStatusRefundDone   SaleStatus = 6  // 退款完成
	SaleStatusClosed       SaleStatus = 7  // 售后关闭
	SaleStatusRefunding    SaleStatus = 8  // 退款中
	SaleStatusQuickRefund  SaleStatus = 9  // 极速退款成功
	SaleStatusCompleted    SaleStatus = 10 // 售后完成
	SaleStatusRefundFailed SaleStatus = 12 // 退款失败
	SaleStatusBuyerCancel  SaleStatus = 13 // 买家取消售后
)

const (
	SaleTypeRefund      SaleType = 1 // 仅退款
	SaleTypeRefundItem  SaleType = 2 // 退货退款
	SaleTypeExchange    SaleType = 3 // 换货
	SaleTypeQuickRefund SaleType = 4 // 极速退款
)

const (
	RefundTypeOnlyRefund RefundType = 1  // 多拍/错拍/不想要
	RefundTypeReturn     RefundType = 8  // 退运费
	RefundTypeExchange   RefundType = 26 // 尺寸拍错/不喜欢/效果不好
	RefundTypeOther      RefundType = 17 // 其他
)

func (s SaleStatus) String() string {
	switch s {
	case SaleStatusPending:
		return "待处理"
	case SaleStatusBuyerReturn:
		return "待买家退货"
	case SaleStatusMerchantRecv:
		return "待商家收货"
	case SaleStatusRefundDone:
		return "退款完成"
	case SaleStatusClosed:
		return "售后关闭"
	case SaleStatusRefunding:
		return "退款中"
	case SaleStatusQuickRefund:
		return "极速退款成功"
	case SaleStatusCompleted:
		return "售后完成"
	case SaleStatusRefundFailed:
		return "退款失败"
	case SaleStatusBuyerCancel:
		return "买家取消售后"
	default:
		return ""
	}
}

func (t SaleType) String() string {
	switch t {
	case SaleTypeRefund:
		return "仅退款"
	case SaleTypeRefundItem:
		return "退货退款"
	case SaleTypeExchange:
		return "换货"
	case SaleTypeQuickRefund:
		return "极速退款"
	default:
		return ""
	}
}

func (r RefundType) String() string {
	switch r {
	case RefundTypeOnlyRefund:
		return "多拍/错拍/不想要"
	case RefundTypeReturn:
		return "退运费"
	case RefundTypeExchange:
		return "尺寸拍错/不喜欢/效果不好"
	case RefundTypeOther:
		return "其他"
	default:
		return ""
	}
}
